package com.gs.SynAntiWandering.adapter;

import android.content.Context;
import android.view.View;

import com.gs.SynAntiWandering.R;
import com.gs.SynAntiWandering.adapter.base.BaseAdapter;
import com.gs.SynAntiWandering.adapter.base.BaseViewHolder;
import com.gs.SynAntiWandering.db.dto.ShortDto;

import java.util.List;

public class TooBarListAdapter extends BaseAdapter<ShortDto> {

    public TooBarListAdapter(Context context, List<ShortDto> mData, int layoutId) {
        super(context, mData, layoutId);
    }

    @Override
    public void convert(BaseViewHolder holder, ShortDto bean, int position) {
        if (bean.getSelect() != null && bean.getSelect()) {
            holder.setVisibility(R.id.item_line, View.VISIBLE);
            holder.setText(R.id.item_text, bean.getName());
        } else {
            holder.setHint(R.id.item_text, bean.getName());
            holder.setVisibility(R.id.item_line, View.GONE);
        }
    }
}